package top.lingkang.authoritypro.data.entity;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author lingkang
 * Created by 2021/12/13
 */
@Entity
@Table(name = "ad_user") // import javax.persistence.Table
@org.hibernate.annotations.Table(appliesTo = "ad_user", comment = "用户表")
@Data
public class User implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)//主键递增策略
    private Long id;

    @Column(length = 40,unique = true)
    private String username;
    @Column(length = 64)
    private String password;
    @Column(length = 20)
    private String nickname;

    @Column
    @UpdateTimestamp
    private Date updateTime;
    @Column
    @CreationTimestamp
    private Date createTime;
}
